import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs'

export const routes = [
  {
    path: '/',
    name: '/',
    meta: {
      title: '依奇笔记',
      requiresAuth: false
    },
    redirect: '/layout'
  },
  {
    path: '/layout',
    meta: {
      title: '首页',
      requiresAuth: false
    },
    redirect: '/layout/home',
    component: () => import('@/views/layout/index.vue'),
    children: [
      {
        path: 'home',
        meta: {
          title: '家',
          requiresAuth: false
        },
        component: () => import('@/views/home/index.vue')
      },
      {
        path: 'user',
        meta: {
          title: '个人信息',
          requiresAuth: true
        },
        component: () => import('@/views/user/index.vue')
      },
      {
        path: 'space/:spaceId/:spaceName',
        meta: {
          title: '空间',
          requiresAuth: true
        },
        component: () => import('@/views/space/index.vue'),
        children: [
          {
            path: 'content',
            name: 'content',
            meta: {
              title: 'content',
              requiresAuth: true
            },
            component: () => import('@/views/space/content.vue')
          }
        ]
      }
    ]
  },
  {
    path: '/login',
    name: 'loginPage',
    meta: {
      title: '依奇笔记登录',
      requiresAuth: false
    },
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/:pathMatch(.*)*',
    name: '404Page',
    meta: {
      title: '404 No Found',
      requiresAuth: false
    },
    component: () => import('@/views/404/index.vue')
  }
]
